From: Florian Müllner Date: Wed, 14 Sep 2011 23:22:29 +0000 (+0200) Subject: network-agent: Focus the first reactive entry X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~7632 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=4e4ce0dd218310337e849ac02de8a174a93e9852;p=gnome-shell.git network-agent: Focus the first reactive entry Currently network dialogs don't focus password entries, which means that rather than entering their password directly, users first have to click the entry (or tab around the dialog). Instead, put keyboard focus on the first entry that requires user input. https://bugzilla.gnome.org/show_bug.cgi?id=659133 --- diff --git a/js/ui/networkAgent.js b/js/ui/networkAgent.js index 90480e7c2..43fd9a14e 100644 --- a/js/ui/networkAgent.js +++ b/js/ui/networkAgent.js @@ -91,6 +91,7 @@ NetworkSecretDialog.prototype = { } let secretTable = new St.Table({ style_class: 'network-dialog-secret-table' }); + let initialFocusSet = false; let pos = 0; for (let i = 0; i < this._content.secrets.length; i++) { let secret = this._content.secrets[i]; @@ -109,6 +110,11 @@ NetworkSecretDialog.prototype = { secret.valid = secret.value.length > 0; if (reactive) { + if (!initialFocusSet) { + this.setInitialKeyFocus(secret.entry); + initialFocusSet = true; + } + secret.entry.clutter_text.connect('text-changed', Lang.bind(this, function() { secret.value = secret.entry.get_text(); if (secret.validate)